package com.yoda.youdianda.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yoda.youdianda.domain.SysMenu;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author shawn
 * @date 2022年 11月 13日 9:39
 */

public interface SysMenuMapper extends BaseMapper<SysMenu> {
    @Select({"<script>" +
            "select menu_id from sys_role_menu where role_id in " +
            "<foreach item='id' index='index' collection='roles_id' open='(' separator=',' close=')'>" +
            "#{id}"+
            "</foreach>"+
            "</script>"})
    List<String> selectMenuIdByRoleIds(@Param("roles_id") List<String> roles_id);

}
